package com.dxt.controller;

import com.dxt.common.AppConstant;
import com.dxt.common.LogHelper;
import com.dxt.model.BusiCodeBean;
import com.dxt.service.CacheManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/api/test", name = "testInterface")
public class TestController {
    private static Logger logger = LoggerFactory.getLogger(TestController.class);

    @Autowired
    CacheManager cacheManager;

    @RequestMapping(value="index")
    public String hello(){
        logger.info(LogHelper._FILE_()+"测试logger");
        logger.info(LogHelper._FUNC_()+"测试logger2");
        BusiCodeBean busiCodeBean = cacheManager.getBusiByCode("20002");
        String value = cacheManager.getSysConfigByCode(AppConstant.SYS_CONFIG_KEY.KEY_REFRESH_CACHE_VERIFICATION_CODE);
       return busiCodeBean.toString()+":"+value;
    }

}
